/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author 王宇
* @date 2023-09-16
**/
@Entity
@Data
@Table(name="course_clock")
public class CourseClock implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "clock_id")
    @ApiModelProperty(value = "主键")
    private Long clockId;

    @Column(name = "clock_no",unique = true)
    @ApiModelProperty(value = "打卡编号")
    private String clockNo;

    @Column(name = "course_no")
    @ApiModelProperty(value = "课程编号")
    private String courseNo;

    @Column(name = "clock_class")
    @ApiModelProperty(value = "打卡班级")
    private String clockClass;

    @Column(name = "class_no")
    @ApiModelProperty(value = "编辑编号")
    private String classNo;

    @Column(name = "nick_name")
    @ApiModelProperty(value = "微信昵称")
    private String nickName;

    @Column(name = "mobile")
    @ApiModelProperty(value = "手机号")
    private String mobile;

    @Column(name = "open_id")
    @ApiModelProperty(value = "openid")
    private String openId;

    @Column(name = "create_time")
    @ApiModelProperty(value = "打卡时间")
    private Timestamp createTime;

    @Column(name = "status")
    @ApiModelProperty(value = "0待审核，1：审核通过，2：不通过，3：优秀")
    private Integer status;

    @Column(name = "clock_content")
    @ApiModelProperty(value = "内容")
    private String clockContent;

    @Column(name = "update_time")
    @ApiModelProperty(value = "更新时间")
    private Timestamp updateTime;

    @Column(name = "updateby")
    @ApiModelProperty(value = "更新人")
    private String updateby;

    @Column(name = "user_name")
    @ApiModelProperty(value = "学员姓名")
    private String userName;

    @Column(name = "visible_auth")
    @ApiModelProperty(value = "全员可见：0，班级可见：1")
    private Integer visibleAuth;

    @Column(name = "excellent")
    @ApiModelProperty(value = "是否优秀打卡0：不是，1：是")
    private Integer excellent;

    @Column(name = "group_number")
    @ApiModelProperty(value = "组号")
    private String groupNumber;

    public void copy(CourseClock source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}